package com.hyq.learn.ai;

import com.hyq.learn.ai.service.McpService;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.Banner;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Bean;

/**
 * @author heyuqin
 * @date 2025/10/16 16:06
 */
@SpringBootApplication(scanBasePackages = {"com.hyq.learn"})
public class AiApplication {

    public static void main(String[] args) {
        new SpringApplicationBuilder()
                .bannerMode(Banner.Mode.OFF)
                .sources(AiApplication.class)
                .run(args);
    }

    @Bean
    public ToolCallbackProvider weatherTools(McpService mcpService) {
        return MethodToolCallbackProvider.builder().toolObjects(mcpService).build();
    }
}
